package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Propertytypelist;
import com.ean.backpack.repository.PropertytypelistRepository;
import com.ean.backpack.service.PropertytypelistService;

@Service
@Transactional
public class PropertytypelistServiceImpl implements PropertytypelistService {

	@Autowired
	PropertytypelistRepository propertytypelistRepository;

	public long countAllPropertytypelists() {
		return propertytypelistRepository.count();
	}

	public void deletePropertytypelist(Propertytypelist propertytypelist) {
		propertytypelistRepository.delete(propertytypelist);
	}

	public Propertytypelist findPropertytypelist(Integer id) {
		return propertytypelistRepository.findOne(id);
	}

	public List<Propertytypelist> findAllPropertytypelists() {
		return propertytypelistRepository.findAll();
	}

	public List<Propertytypelist> findPropertytypelistEntries(int firstResult,
			int maxResults) {
		return propertytypelistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void savePropertytypelist(Propertytypelist propertytypelist) {
		propertytypelistRepository.save(propertytypelist);
	}

	public Propertytypelist updatePropertytypelist(
			Propertytypelist propertytypelist) {
		return propertytypelistRepository.save(propertytypelist);
	}
}
